package com.ping.study.model.dto.tx;

import lombok.Data;
import java.time.DayOfWeek;
import java.util.Map;

@Data
public class LiveInfoRequest {

    private String ckey;
    private String encryptVer;
    private String platform;
    private String tm;
    private String cnlid;
    //private String cookie =

    public static final String  getCookie() {
        return "pgv_pvid=67939534; fqm_pvqid=5e0a1a80-2ffb-42c9-8878-99ef08c0bd21; RK=dudkRjOGUW; ptcz=d9e319494b15cb621d9f54a8e03a1b55fb6c6c3564ff6c4985d1ff7b4797ce4e; video_platform=2; qq_domain_video_guid_verify=119f9c981e9ffd34; _qimei_uuid42=184170b170810037e9eacb93c4fe35a57c7df28f38; _qimei_q36=; _qimei_h38=215914e0566ee066f810eb4b0200000e81840b; video_guid=119f9c981e9ffd34; tvfe_boss_uuid=d41b10b066856291; eas_sid=E1i7L1k4j4D7q1D0Q5J894p636; livelink_pvid=7900946432; check_16=584445b5d815fd331bb7206205f8c603; _qimei_fingerprint=3c06d28104a1e802703470a164d81dca; vqq_refresh_token=; vqq_next_refresh_time=6196; vqq_login_time_init=1745153828; v_qq_com_session_lapse_time=1745160024778; vqq_appid=101481799; vqq_openid=2E6A77E3002C87A9CA68908FB058D4E5; vqq_access_token=308C7CAFBC867AF65212034AC90E71D9; vqq_vuserid=3468482246; vqq_vusession=Kcz0B9FBUDZuIvwHKErD3g.N";
    }

    // 密钥映射表
    private static final Map<DayOfWeek, String> WEEKDAY_KEYS = Map.of(
            DayOfWeek.MONDAY, "06fc1464",
            DayOfWeek.TUESDAY, "4244ce1b",
            DayOfWeek.WEDNESDAY, "77de31c5",
            DayOfWeek.THURSDAY, "e0149fa2",
            DayOfWeek.FRIDAY, "60394ced",
            DayOfWeek.SATURDAY, "2da639f0",
            DayOfWeek.SUNDAY, "c2f0cf9f"
    );

    // 生成加密版本号
    public static String generateEncryptVer(DayOfWeek dayOfWeek) {
        int dayValue = dayOfWeek == DayOfWeek.SUNDAY ? 7 : dayOfWeek.getValue();
        return "7." + dayValue;
    }

    // 获取当天密钥
    public static String getTodaySecretKey() {
        return WEEKDAY_KEYS.get(DayOfWeek.from(java.time.LocalDate.now()));
    }
}